package com.jbit.examSystem.controller;

import com.jbit.examSystem.pojo.Class;
import com.jbit.examSystem.pojo.TableDataInfo;
import com.jbit.examSystem.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("class")
public class ClassController {
    @Autowired
    private ClassService classService;

    @RequestMapping("getAllClass")
    @ResponseBody
    public TableDataInfo getAllClass(Integer teacherId){
        TableDataInfo respDate = new TableDataInfo();
        List<Class> classes = classService.getAllClass(teacherId);
        respDate.succeed(classes, 0);
        return respDate;
    }
}
